package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description NursingLevelMapper
 * @Author hu hanSan
 * @Date 2024-09-09
 */
@Mapper
public interface NursingLevelMapper {
    //查询所有护理等级
    @Select("select *from nursing_level")
    List<NursingLevelVo> selectListAll();

    void insertLevel(NursingLevel nursingLevel);

    Page<NursingLevelVo> getByPage(String name, Integer status);

    @Select("select nl.*,np.plan_name planName,np.id planId from  nursing_level nl left join nursing_plan np on nl.lplan_id=np.id where nl.id=#{id}")
    NursingLevel getById(Long id);

    void putStatus(Long id, Integer status);

    //根据id来删除
    @Delete("delete from nursing_level where id=#{id}")
    void deleteById(Integer id);

    void updateLevel(NursingLevel nursingLevel);
}
